package com.ss.android.article.base.ui;

import android.annotation.TargetApi;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.Checkable;
import android.widget.LinearLayout;

public class CheckableLinearLayout extends LinearLayout implements Checkable {
    private static final int[] a = new int[]{16842912};
    private boolean b;

    public CheckableLinearLayout(Context arg1) {
        super(arg1);
    }

    public CheckableLinearLayout(Context arg1, AttributeSet arg2) {
        super(arg1, arg2);
    }

    @TargetApi(value = 11)
    public CheckableLinearLayout(Context arg1, AttributeSet arg2, int arg3) {
        super(arg1, arg2, arg3);
    }

    public boolean isChecked() {
        return this.b;
    }

    protected int[] onCreateDrawableState(int arg3) {
        int[] v0 = super.onCreateDrawableState(arg3 + 1);
        if (this.isChecked()) {
            CheckableLinearLayout.mergeDrawableStates(v0, CheckableLinearLayout.a);
        }

        return v0;
    }

    public void setChecked(boolean arg1) {
        this.b = arg1;
        this.refreshDrawableState();
        this.invalidate();
    }

    public void toggle() {
        boolean v0 = !this.b ? true : false;
        this.setChecked(v0);
    }
}

